Make WorkspaceClientCapabilities.resourceOperations optional#28
Merged
mattmassicotte merged 1 commit intoChimeHQ:mainfrom May 28, 2025
Merged
Make WorkspaceClientCapabilities.resourceOperations optional#28mattmassicotte merged 1 commit intoChimeHQ:mainfrom
mattmassicotte merged 1 commit intoChimeHQ:mainfrom
Conversation
According to spec: https://microsoft.github.io/language-server-protocol/specifications/specification-3-14/ WorkspaceClientCapabilities.resourceOperations is optional. Eglot (https://www.gnu.org/software/emacs/manual/html_mono/eglot.html) does not send this field which results in error: ``` [jsonrpc] e[14:17:54.582] --> initialize[1] { "id": 1, "jsonrpc": "2.0", "method": "initialize", "params": { "capabilities": { "experimental": {}, "general": { "positionEncodings": [ "utf-32", "utf-8", "utf-16" ] }, "textDocument": { "codeAction": { "codeActionLiteralSupport": { "codeActionKind": { "valueSet": [ "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" ] } }, "dataSupport": true, "dynamicRegistration": false, "isPreferredSupport": true, "resolveSupport": { "properties": [ "edit", "command" ] } }, "completion": { "completionItem": { "deprecatedSupport": true, "insertReplaceSupport": true, "resolveSupport": { "properties": [ "documentation", "details", "additionalTextEdits" ] }, "snippetSupport": true, "tagSupport": { "valueSet": [ 1 ] } }, "contextSupport": true, "dynamicRegistration": false }, "declaration": { "dynamicRegistration": false, "linkSupport": true }, "definition": { "dynamicRegistration": false, "linkSupport": true }, "documentHighlight": { "dynamicRegistration": false }, "documentSymbol": { "dynamicRegistration": false, "hierarchicalDocumentSymbolSupport": true, "symbolKind": { "valueSet": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 ] } }, "formatting": { "dynamicRegistration": false }, "hover": { "contentFormat": [ "markdown", "plaintext" ], "dynamicRegistration": false }, "implementation": { "dynamicRegistration": false, "linkSupport": true }, "inlayHint": { "dynamicRegistration": false }, "publishDiagnostics": { "codeDescriptionSupport": false, "relatedInformation": false, "tagSupport": { "valueSet": [ 1, 2 ] } }, "rangeFormatting": { "dynamicRegistration": false }, "references": { "dynamicRegistration": false }, "rename": { "dynamicRegistration": false }, "signatureHelp": { "dynamicRegistration": false, "signatureInformation": { "activeParameterSupport": true, "documentationFormat": [ "markdown", "plaintext" ], "parameterInformation": { "labelOffsetSupport": true } } }, "synchronization": { "didSave": true, "dynamicRegistration": false, "willSave": true, "willSaveWaitUntil": true }, "typeDefinition": { "dynamicRegistration": false, "linkSupport": true } }, "window": { "showDocument": { "support": true }, "workDoneProgress": true }, "workspace": { "applyEdit": true, "configuration": true, "didChangeWatchedFiles": { "dynamicRegistration": true }, "executeCommand": { "dynamicRegistration": false }, "symbol": { "dynamicRegistration": false }, "workspaceEdit": { "documentChanges": true }, "workspaceFolders": true } }, "clientInfo": { "name": "Eglot", "version": "1.18" }, "initializationOptions": {}, "processId": 92947, "rootPath": "<redacted>", "rootUri": "<redacted>", "workspaceFolders": [ { "name": "<redacted>", "uri": "<redacted>" } ] } } [stderr] 2025-05-27T14:17:54+0300 info com.kattouf.package-swift-lsp : [PackageSwiftLSPLibrary] Starting server [stderr] 2025-05-27T14:17:54+0300 error com.kattouf.package-swift-lsp : [PackageSwiftLSPLibrary] Received error: keyNotFound(CodingKeys(stringValue: "resourceOperations", intValue: nil), Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "params", intValue: nil), CodingKeys(stringValue: "capabilities", intValue: nil), CodingKeys(stringValue: "workspace", intValue: nil), CodingKeys(stringValue: "workspaceEdit", intValue: nil)], debugDescription: "No value associated with key CodingKeys(stringValue: \"resourceOperations\", intValue: nil) (\"resourceOperations\").", underlyingError: nil)) ```
Contributor
|
Thank you so much for finding this and making a PR! These things can be incredibly hard to track down. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
According to spec:
https://microsoft.github.io/language-server-protocol/specifications/specification-3-14/
WorkspaceClientCapabilities.resourceOperations is optional
Eglot (https://elpa.gnu.org/devel/eglot.html) does not send this field which results in error: